<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require 'defaultController.php';

class artController extends defaultController {
    function indexAction(){
         $this -> _view('art.tpl.php');
    }
    function addAction(){
        var_dump($_POST);
    }
    function backAction(){
        if($_SESSION['userid']){
            $member_id=$_SESSION['userid'];
        }else{
            $member_id=0;
        }
        $data=array(
            'content'=>$this->for_post('content'),
            'member_name'=>$this->for_post('user'),
            'member_id'=>$member_id,
            'time'=> date("Y/m/d"),
            'art_id'=>$this->for_get('id')
        );
        $result=$this->_model('backmess')->add($data); 
        if($result){
            $this->redirectPage("index.php?c=index&a=read&id=".$this->for_get('id'));
        }else{
            $this->showMessage("评论成功");  
        }

    }
};